<template>
    <div class="home-container">
      <h1>欢迎来到主页</h1>
      <button @click="handleLogout">退出登录</button>
    </div>
  </template>
  
  <script setup>
  import { useRouter } from 'vue-router'
  
  const router = useRouter()
  
  const handleLogout = () => {
    localStorage.removeItem('token')
    router.push('/login')
  }
  </script>
  
  <style scoped>
  .home-container {
    text-align: center;
    padding: 50px;
  }
  
  button {
    padding: 10px 20px;
    background-color: #f56c6c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }
  </style>